﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AdminModel;
using System.Web.Script.Serialization;
using System.Data;
using System.Collections;

namespace WinePro.Logic
{
    public class logic
    {
        #region 公告管理的相关操作
        /// <summary>
        /// 显示公告信息
        /// </summary>
        /// <returns></returns>
        public List<Notice> GetNotice()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetNotice());
            List<Notice> list = new List<Notice>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                Notice notice = new Notice();
                notice.NoticeID = Convert.ToInt32(i["NoticeID"]);
                notice.NoticeContent = i["NoticeContent"].ToString();
                notice.NoticeDate = Convert.ToDateTime(i["NoticeDate"]);
                notice.NoticeStart = Convert.ToInt32(i["NoticeStart"]);
                notice.NoticeTitle = i["NoticeTitle"].ToString();
                list.Add(notice);
            }
            return list;
        }
        /// <summary>
        /// 添加公告信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public int AddNotice(Notice notice)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            notice.NoticeDate = Convert.ToDateTime(DateTime.Now.ToShortTimeString());
            notice.NoticeStart = 1;
            return Client.AddNotice(notice);
        }
        /// <summary>
        /// 删除公告信息
        /// </summary>
        /// <param name="NoticeID"></param>
        /// <returns></returns>
        public int DeleteNotice(int NoticeID)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.DeleteNotice(NoticeID);
        }
        /// <summary>
        /// 修改公告信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public int EditNotice(Notice notice)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            int i = Client.UpdateNotice(notice);
            return i;
        }
        #endregion
        #region 管理员管理的相关操作
        /// <summary>
        /// 显示管理员列表
        /// </summary>
        /// <returns></returns>
        public List<Admins> GetAdmins()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetAdmins1());
            List<Admins> list = new List<Admins>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                Admins admin = new Admins();
                admin.AdminsID = Convert.ToInt32(i["AdminsID"]);
                admin.AdminsNumber = i["AdminsNumber"].ToString();
                admin.AdminsPwd = Convert.ToString(i["AdminsPwd"]);
                admin.AdminsRoleID = Convert.ToInt32(i["AdminsRoleID"]);
                admin.AdminStart = int.Parse(i["AdminStart"].ToString());
                admin.AdminsTel = int.Parse(i["AdminsTel"].ToString());
                admin.AdminDate = Convert.ToDateTime(i["AdminDate"]);
                admin.AdminsEmail = i["AdminsEmail"].ToString();
                list.Add(admin);
            }
            return list;
        }
        /// <summary>
        /// 显示管理员角色列表
        /// </summary>
        /// <returns></returns>
        public List<AdminsRole> GetAdminsRole()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetAdminRole());
            List<AdminsRole> list = new List<AdminsRole>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                AdminsRole adminsrole = new AdminsRole();
                adminsrole.AdminsRoleID = Convert.ToInt32(i["AdminsRoleID"]);
                adminsrole.AdminsRoleName = i["AdminsRoleName"].ToString();
                list.Add(adminsrole);
            }
            return list;
        }
        /// <summary>
        /// 显示管理员权限列表
        /// </summary>
        /// <returns></returns>
        public List<AdminsPower> GetAdminsPower()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetAdminsPower());
            List<AdminsPower> list = new List<AdminsPower>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                AdminsPower adminspower = new AdminsPower();
                adminspower.AdminsPowerID = Convert.ToInt32(i["AdminsPowerID"]);
                adminspower.AdminsPowerName = i["AdminsPowerName"].ToString();
                adminspower.AdminsPowerWay = i["AdminsPowerWay"].ToString();
                list.Add(adminspower);
            }
            return list;
        }
        /// <summary>
        /// 显示管理员角色权限列表
        /// </summary>
        /// <returns></returns>
        public List<RolePower> GetRolePower()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetRolePower());
            List<RolePower> list = new List<RolePower>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                RolePower adminspower = new RolePower();
                adminspower.RolePowerID = Convert.ToInt32(i["RolePowerID"]);
                adminspower.AdminsPowerID = int.Parse(i["AdminsPowerID"].ToString());
                adminspower.AdminsRoleID = int.Parse(i["AdminsRoleID"].ToString());
                list.Add(adminspower);
            }
            return list;
        }
        /// <summary>
        /// 修改管理员状态
        /// </summary>
        /// <param name="admin"></param>
        /// <returns></returns>
        public int EditAdmins(Admins admin)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.UpdateAdmins2(admin);
        }
        /// <summary>
        /// 添加管理员
        /// </summary>
        /// <param name="admin"></param>
        /// <returns></returns>
        public int AddAdmins(Admins admin)
        {
            admin.AdminDate = DateTime.Now;
            admin.AdminStart = 1;
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.AddAdmins1(admin);
        }
        #endregion
        #region 用户管理的相关操作
        /// <summary>
        /// 显示用户信息
        /// </summary>
        /// <returns></returns>
        public List<Users> GetUsers()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetUsers());
            List<Users> list = new List<Users>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                Users users = new Users();
                users.UsersID = Convert.ToInt32(i["UsersID"]);
                users.UsersPwd = Convert.ToInt32(i["UsersPwd"]);
                users.UsersName = i["UsersName"].ToString();
                users.UsersStart = Convert.ToInt32(i["UsersStart"]);
                users.UsersRoleID = Convert.ToInt32(i["UsersRoleID"]);
                users.UsersTel = Convert.ToInt32(i["UsersTel"]);
                list.Add(users);
            }
            return list;
        }
        /// <summary>
        /// 用户角色名称显示
        /// </summary>
        /// <returns></returns>
        public List<UsersRole> GetUsersRole()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetUsersRole());
            List<UsersRole> list = new List<UsersRole>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                UsersRole users = new UsersRole();
                users.UsersRoleID = Convert.ToInt32(i["UsersRoleID"]);
                users.UsersRoleName = i["UsersRoleName"].ToString();
                list.Add(users);
            }
            return list;
        }
        // <summary>
        /// 删除用户信息
        /// </summary>
        /// <param name="UsersID"></param>
        /// <returns></returns>
        public int DeleteUsers(int UsersID)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.DelectUsers(UsersID);
        }
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>-
        public int UpdateUsers(Users notice)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            int i = Client.UpdateUsers(notice);
            return i;
        }

        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="users"></param>
        /// <returns></returns>
        public int AddUsers1(Users users)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            users.UsersStart = 0;
            return Client.AddUsers(users);
        }
        #endregion
        #region 订单管理的相关操作
        /// <summary>
        /// 显示订单信息
        /// </summary>
        /// <returns></returns>
        public List<Indent> GetIndent()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetIndent());
            List<Indent> list = new List<Indent>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                Indent Indent = new Indent();
                Indent.IndentID = Convert.ToInt32(i["IndentID"]);
                Indent.IndentNumbers = i["IndentNumbers"].ToString();
                Indent.IndentStart = Convert.ToInt32(i["IndentStart"]);
                Indent.IndentDate = Convert.ToDateTime(i["IndentDate"]);
                Indent.UsersID = Convert.ToInt32(i["UsersID"]);
                Indent.ConsigneeName = i["ConsigneeName"].ToString();
                Indent.Indentship = Convert.ToInt32(i["Indentship"]);
                Indent.IndentPay = Convert.ToInt32(i["IndentPay"].ToString());
                Indent.AreaID = Convert.ToInt32(i["AreaID"]);
                Indent.ConsigneeAddr = i["ConsigneeAddr"].ToString();
                Indent.ConsigneeTel = Convert.ToInt32(i["ConsigneeTel"]);
                list.Add(Indent);
            }
            return list;
        }
        /// <summary>
        /// 订单从表
        /// </summary>
        /// <returns></returns>
        public List<Ind> GetInt()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetInd());
            List<Ind> list = new List<Ind>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                Ind ss = new AdminModel.Ind();
                ss.IndID = Convert.ToInt32(i["IndID"]);
                ss.IndNum = Convert.ToInt32(i["IndNum"]);
                ss.IndPrice = Convert.ToInt32(i["IndPrice"]);
                ss.GoodsID = Convert.ToInt32(i["GoodsID"]);
                ss.IndentID = Convert.ToInt32(i["IndentID"]);

                list.Add(ss);
            }
            return list;
        }
        public int AddInt(Ind ss)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();

            return Client.AddInd(ss);
        }
        #endregion
        #region 订单管理的相关操作
        /// <summary>
        /// 添加订单信息
        /// </summary>
        /// <param name="indent"></param>
        /// <returns></returns>
        public int AddIndent(Indent Indent)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            Indent.IndentDate = DateTime.Now;
            return Client.AddIndent(Indent);
        }
        /// <summary>
        /// 删除订单信息
        /// </summary>
        /// <param name="IndentID"></param>
        /// <returns></returns>
        public int DeleteIndent(int IndentID)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.DeleteIndent(IndentID);
        }
        /// <summary>
        /// 修改订单信息
        /// </summary>
        /// <param name="indent"></param>
        /// <returns></returns>
        public int EditIndent(Indent indent)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            int i = Client.UpdateIndent(indent);
            return i;
        }
        #endregion
        #region 退货管理的相关操作
        /// <summary>
        /// 显示退货信息
        /// </summary>
        /// <returns></returns>
        public List<Renturned> GetRenturned()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetRenturned());
            List<Renturned> list = new List<Renturned>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                Renturned Renturned = new Renturned();
                Renturned.ReturnedID = Convert.ToInt32(i["ReturnedID"]);
                Renturned.ReturnedNum = Convert.ToInt32(i["ReturnedNum"].ToString());
                Renturned.ReturnedStart = Convert.ToInt32(i["ReturnedStart"]);
                // Renturned.RenturnedDate = Convert.ToDateTime(i["ReturnedStart"]);
                Renturned.IndentID = Convert.ToInt32(i["IndentID"]);
                Renturned.Reason = i["Reason"].ToString();
                list.Add(Renturned);
            }
            return list;
        }
        /// <summary>
        /// 添加退货信息
        /// </summary>
        /// <param name="Renturned"></param>
        /// <returns></returns>
        public int AddRenturned(Renturned Renturned)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            //Renturned.RenturnedDate = DateTime.Now;
            return Client.AddRenturned(Renturned);
        }
        /// <summary>
        /// 删除退货信息
        /// </summary>
        /// <param name="RenturnedID"></param>
        /// <returns></returns>
        public int DeleteRenturned(int RenturnedID)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.DeleteNotice(RenturnedID);
        }
        /// <summary>
        /// 修改退货信息
        /// </summary>
        /// <param name="Renturned"></param>
        /// <returns></returns>
        public int EditRenturned(Renturned Renturned)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            int i = Client.UpdateRenturned(Renturned);
            return i;
        }
        #endregion
        #region 评论管理的相关操作
        /// <summary>
        /// 显示评论信息
        /// </summary>
        /// <returns></returns>
        public List<Comment> GetComment()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetComment());
            List<Comment> list = new List<Comment>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                Comment Comment = new Comment();
                Comment.CommentID = Convert.ToInt32(i["CommentID"]);
                Comment.CommentImg = i["CommentImg"].ToString();
                Comment.GoodsID = Convert.ToInt32(i["GoodsID"]);
                Comment.CommentStar = Convert.ToInt32(i["CommentStar"]);
                Comment.CommentContent = i["CommentContent"].ToString();
                Comment.UsersID = Convert.ToInt32(i["UsersID"]);
                Comment.PraiseNum = Convert.ToInt32(i["PraiseNum"]);
                Comment.CommentDate = Convert.ToDateTime(i["CommentDate"].ToString());
                list.Add(Comment);
            }
            return list;
        }
        /// <summary>
        /// 添加评论信息
        /// </summary>
        /// <param name="Renturned"></param>
        /// <returns></returns>
        public int AddComment(Comment Comment)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            Comment.CommentDate = DateTime.Now;
            return Client.AddComment(Comment);
        }
        /// <summary>
        /// 删除评论信息
        /// </summary>
        /// <param name="RenturnedID"></param>
        /// <returns></returns>
        public int DeleteComment(int CommentID)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.DeleteNotice(CommentID);
        }
        /// <summary>
        /// 修改评论信息
        /// </summary>
        /// <param name="Renturned"></param>
        /// <returns></returns>
        public int EditComment(Comment Comment)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            int i = Client.UpdateComment(Comment);
            return i;
        }
        #endregion
        #region 商品信息管理的相关操作
        /// <summary>
        /// 显示商品信息
        /// </summary>
        /// <returns></returns>
        public List<GoodsMessage> GetGoodsMessage()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetGoodsMessage());
            List<GoodsMessage> list = new List<GoodsMessage>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                GoodsMessage me = new GoodsMessage();
                me.GoodsID = Convert.ToInt32(i["GoodsID"]);
                me.GoodsName = i["GoodsName"].ToString();
                me.GoodsAlcohol = i["GoodsAlcohol"].ToString();
                me.GoodsNum = Convert.ToInt32(i["GoodsNum"]);
                me.GoodsPrice = Convert.ToInt32(i["GoodsPrice"]);
                me.GoodsStart = Convert.ToInt32(i["GoodsStart"]);
                me.GoodsWinery = i["GoodsWinery"].ToString();
                me.GoodsYear = Convert.ToDateTime(i["GoodsYear"]);
                me.GoodsStandard = i["GoodsStandard"].ToString();
                me.GoodsVolume = Convert.ToInt32(i["GoodsVolume"]);
                me.GoodsStock = i["GoodsStock"].ToString();
                me.GoodsProcess = i["GoodsProcess"].ToString();
                me.GoodsStore = i["GoodsStore"].ToString();
                me.GoodsOdor = i["GoodsOdor"].ToString();
                me.GoodsBox = i["GoodsBox"].ToString();
                me.GoodsAddr = i["GoodsAddr"].ToString();
                me.GoodsTypeID = Convert.ToInt32(i["GoodsTypeID"]);
                me.GoodsImg = i["GoodsImg"].ToString();
                list.Add(me);
            }
            return list;
        }

      
        /// <summary>
        /// 显示商品信息
        /// </summary>
        /// <returns></returns>
        public List<GoodsType> GetGoodsType()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetGoodsType());
            List<GoodsType> list = new List<GoodsType>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                GoodsType ty = new GoodsType();
                ty.GoodsTypeID = Convert.ToInt32(i["GoodsTypeID"]);
                ty.GoodsTypeName = i["GoodsTypeName"].ToString();
                list.Add(ty);
            }
            return list;
        }
        /// <summary>
        /// 添加商品信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public int AddGoodsMessage(GoodsMessage go)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.AddGoodsMessage(go);

        }
        /// <summary>
        /// 删除商品信息
        /// </summary>
        /// <param name="NoticeID"></param>
        /// <returns></returns>
        public int DeleteGoodsMessage(int GoodsID)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.DeleteGoodsMessage(GoodsID);
        }
        /// <summary>
        /// 修改商品信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public int EditGoodsMessage(GoodsMessage goods)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            int i = Client.UpdateGoodsMessage(goods);
            return i;
        }
              
        #endregion
        #region 购物车管理相关操作 
        /// <summary>
        /// 购物车显示数据
        /// </summary>
        /// <returns></returns>
        public List<Shop> GetShop()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();

            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetShop());
            List<Shop> list = new List<Shop>();
            foreach (System.Collections.Generic.Dictionary<string, object> item in ary)
            {
                Shop ss = new Shop();
                ss.ShopID = Convert.ToInt32(item["ShopID"]);
                ss.ShopDate = Convert.ToDateTime(item["ShopDate"]);
                ss.IndentID = Convert.ToInt32(item["IndentID"]);
                ss.GoodsID = Convert.ToInt32(item["GoodsID"]);
                list.Add(ss);
            }
            return list;
        }

        /// <summary>
        /// 显示地区信息
        /// </summary>
        /// <returns></returns>
        public List<Area> GetArea()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            List<Area> list = new List<Area>();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetArea());
            foreach (System.Collections.Generic.Dictionary<string, object> item in ary)
            {
                Area aa = new Area();

                aa.AreaID = Convert.ToInt32(item["AreaID"]);
                aa.AreaName = item["AreaName"].ToString();
                aa.UpperStory = Convert.ToInt32(item["UpperStory"]);

                list.Add(aa);
            }
            return list;

        }
        /// <summary>
        /// 添加购物车
        /// </summary>
        /// <param name="ss"></param>
        /// <returns></returns>
        public int AddShop(Shop ss)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            ss.ShopDate = DateTime.Now;
            return Client.AddShop(ss);
        }
        /// <summary>
        /// 删除购物车数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteShop(int id)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.DeleteShop(id);
        }
        /// <summary>
        /// 修改购物车数据信息
        /// </summary>
        /// <param name="ss"></param>
        /// <returns></returns>
        public int EditShop(Shop ss)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            int i = Client.UpdateShop(ss);
            return i;
        }
        #endregion
        #region 收藏的相关操作
        /// <summary>
        /// 显示收藏信息
        /// </summary>
        /// <returns></returns>
        public List<Cikkect> GetCikkect()
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            JavaScriptSerializer json = new JavaScriptSerializer();
            json.MaxJsonLength = Int32.MaxValue;
            ArrayList ary = json.Deserialize<ArrayList>(Client.GetCikkect());
            List<Cikkect> list = new List<Cikkect>();
            foreach (System.Collections.Generic.Dictionary<string, object> i in ary)
            {
                Cikkect notice = new Cikkect();
                notice.CollectID = Convert.ToInt32(i["CollectID"]);
                notice.GoodsID = Convert.ToInt32(i["GoodsID"]);
                notice.UsersID = Convert.ToInt32(i["UsersID"]);
                list.Add(notice);
            }
            return list;
        }
        /// <summary>
        /// 添加收藏信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public int AddCikkect(Cikkect notice)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.AddCikkect(notice);
        }
        /// <summary>
        /// 删除收藏信息
        /// </summary>
        /// <param name="CikkectID"></param>
        /// <returns></returns>
        public int DeleteCikkect(int CikkectID)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            return Client.DeleteCikkect(CikkectID);
        }
        /// <summary>
        /// 修改收藏信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public int EditCikkect(Cikkect notice)
        {
            ServiceReference1.Service1Client Client = new ServiceReference1.Service1Client();
            int i = Client.UpdateCikkect(notice);
            return i;
        }
        #endregion


    }
}